package com.bh.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;

import javax.servlet.RequestDispatcher;

/**
 * @author Wang
 * @version 1.0
 * @date 2022/6/9 14:46
 */
public class RouteFilter extends ZuulFilter {
    @Override
    public String filterType() {
        return "route";
    }

    @Override
    public int filterOrder() {
        return 0;
    }

    @Override
    public boolean shouldFilter() {
        return false;
    }

    @Override
    public Object run() throws ZuulException {
        RequestContext requestContext=RequestContext.getCurrentContext();
        String token=requestContext.get("token").toString();
        System.out.println("token>>>>"+token);
        return null;
    }
}
